<?php
declare (strict_types=1);

namespace app\services\log;

use app\services\BaseServices;
use app\dao\log\UserLoginLogDao;
use think\db\exception\{DataNotFoundException, DbException, ModelNotFoundException};

/**
 *
 * Class UserLoginLogServices
 * @package app\services\log
 * @mixin UserLoginLogDao
 */
class UserLoginLogServices extends BaseServices
{

    /**
     * UserLoginLogServices constructor.
     * @param UserLoginLogDao $dao
     */
    public function __construct(UserLoginLogDao $dao)
    {
        $this->dao = $dao;
    }

    /**
     * 登录日志
     * @param array $whereData
     * @param array $with
     * @return array
     * @throws DbException
     */
    public function getLogList(array $whereData, array $with = ['user']): array
    {
        [$page, $limit] = $this->getPageValue();
        return $this->dao->getLogList($whereData, $page, $limit, $with);
    }
}
